from flask import Flask
from flask_cors import CORS
# 新建服务
server = Flask("app")

CORS(server, supports_credentials=True)


@server.route('/')
def index():
    return 'Hello flask!'


@server.route('/info')
def get_info():
    # 读取文件
    file = open('info.json', 'r', encoding='utf-8')
    data = file.read()
    file.close()

with open('info.json', 'r', encoding='utf-8') as f:
        data = f.read()

server.run('0.0.0.0', port=8080)
